<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="logic.newLogic2.Facade3"%><html>
<head>
<title>secret 4 plus dog</title>
<meta http-equiv="Content-Type"
	content="text/html; charset=windows-1255">
<link href="secret4.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FF6600" dir="ltr">
<a href=login.jsp> logout </a>
<table height="100%" width="100%" border="0" cellspacing="3"
	cellpadding="2">
	<tr>
		<td width="10%">&nbsp;</td>
		<td valign="top">
		<table height="100%" width="100%" border="0" cellspacing="3"
			cellpadding="2">
			<tr height="20%">
				<td>&nbsp;</td>
			</tr>
			<tr height="80%">
				<td>
				<table align="left" width="100%" border="0" cellspacing="3"
					cellpadding="2">
					<tr>
						<td width="65%" align="left" valign="top">
						<table width="100%" border="0" cellspacing="3" cellpadding="2">
							<tr>
								<td class="title"><% out.print((String) session.getAttribute("currentUser")); %>'s Profile </td>
							</tr>
							<tr>
								<td>
								<table width="100%" border="0" cellspacing="3" cellpadding="2">
									<tr>
										<td class="error">
										<%
										int ratings = 0;
										if ((String)session.getAttribute("currentUser")==null){
											response.sendRedirect("login.jsp");
										} else {
											ratings = Facade3.getInstance().getNumRating(
													(String) session.getAttribute("currentUser"));
											if (ratings < 10) {
												out
														.println("New user: You need to rate "
																+ (10-ratings)
																+ " more movies for the system to efficiently recommend for you");
											}
										}
										%>
										</td>
									</tr>
									<tr>
										<td>
										<form method="post" action="facade.jsp"><input
											type="hidden" name="form" value="userPanel">
										<table class="bolded" width="100%" border="0" cellspacing="3"
											cellpadding="2">

											<tr>
												<td><input type="submit" class="button" name="action"
													title="Changing your personal details" value="Change My Personal Details"></td>
											</tr>
											<tr>
												<td>&nbsp;</td>
											</tr>
											<tr>
												<td><input type="submit"
													class="<%out.println((ratings < 10) ? "specialButton" : "button");%>"
													name="action" title="Rate a movie of your choice"
													value="I Want To Rate A Movie"></td>
											</tr>
											<tr>
												<td>&nbsp;</td>
											</tr>
											<tr>
												<td><input type="submit" class="button" name="action"
													title="Get a movie recommendation" value="What movies should I watch?"></td>
											</tr>
											<tr>
												<td>&nbsp;</td>
											</tr>
											<%
											if (session.getAttribute("type")!=null && (session.getAttribute("type").equals("admin") || Facade3.getInstance().isManager((String)session.getAttribute("currentUser")))) {

													out.println("<tr>");
													out
															.println("<td><input type=\"submit\" class=\"button\" name=\"action\" title=\"Remove movies from the data base\" value=\"Delete a movie\"></td>");
													out.println("</tr>");
													out.println("<tr>");
													out.println("<td>&nbsp;</td>");
													out.println("</tr>");
													out.println("<tr>");
													out
															.println("<td><input type=\"submit\" class=\"button\" name=\"action\" title=\"Remove users from the data base\" value=\"Delete a user\"></td>");
													out.println("</tr>");
													out.println("<tr>");
													out.println("<td>&nbsp;</td>");
													out.println("</tr>");
													out.println("<tr>");
													out
															.println("<td><input type=\"submit\" class=\"button\" name=\"action\" title=\"Add a movie to the data base\" value=\"Add a movie\"></td>");
													out.println("</tr>");
													out.println("<tr>");
													out.println("<td>&nbsp;</td>");
													out.println("</tr>");
													out.println("<tr>");
													out
															.println("<td><input type=\"submit\" class=\"button\" name=\"action\" title=\"Set administrator permission to other users\" value=\"Administrator permission\"></td>");
													out.println("</tr>");
													out.println("<tr>");
													out.println("<td>&nbsp;</td>");
													out.println("</tr>");

												}
											%>
											<%

												if (session.getAttribute("currentUser")!=null && Facade3.getInstance().isManager((String)session.getAttribute("currentUser"))) {

													out.println("<tr>");
													out
															.println("<td><input type=\"submit\" class=\"button\" name=\"action\" title=\"Set manager permission to other users\" value=\"Manager permission\"></td>");
													out.println("</tr>");
													out.println("<tr>");
													out.println("<td>&nbsp;</td>");
													out.println("</tr>");


													out.println("<tr>");
													out
															.println("<td><input type=\"submit\" class=\"button\" name=\"action\" title=\"Watch reports\" value=\"Reports\"></td>");
													out.println("</tr>");
													out.println("<tr>");
													out.println("<td>&nbsp;</td>");
													out.println("</tr>");
													out.println("<tr>");
													out.println("<td>&nbsp;</td>");
													out.println("</tr>");
													out.println("<tr>");
													out.println("<td>&nbsp;</td>");
													out.println("</tr>");
												}
											%>
										</table>
										</form>
										</td>
									</tr>
								</table>
								</td>
							</tr>
						</table>
						</td>
						<td valign="top"><img src="Secret4PlusDog.jpg" width="220"
							height="407"></td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
		<td width="10%">&nbsp;</td>
	</tr>
</table>

</body>
</html>
